home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ppppsssseeeemmmmaaaa((((DDDD3333XXXX)))) ppppsssseeeemmmmaaaa((((DDDD3333XXXX))))
-
-
-
- NNNNAAAAMMMMEEEE
- _pppp_ssss_eeee_mmmm_aaaa - perform a "P" or wait semaphore operation
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_""""
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_pppp_aaaa_rrrr_aaaa_mmmm_...._hhhh_""""
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_ssss_eeee_mmmm_aaaa_...._hhhh_""""
-
- _pppp_ssss_eeee_mmmm_aaaa_((((_ssss_eeee_mmmm_aaaa______tttt _****_s_e_m_a_p_,,,, _iiii_nnnn_tttt _f_l_a_g_s_))))_;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _pppp_ssss_eeee_mmmm_aaaa performs a "P" semaphore operation on the given semaphore. The
- value associated with the semaphore is decremented by 1. If the
- semaphore value then becomes less than 0, the process goes to sleep and
- gives up the CPU.
-
- Use _s_e_m_a_p to pass _pppp_ssss_eeee_mmmm_aaaa a pointer to the semaphore you want to decrement.
- Use _f_l_a_g_s to specify whether you want the process to be able to be woken
- by a signal if it ends up going to sleep. A flag value of (_f_l_a_g_s &
- _PPPP_MMMM_AAAA_SSSS_KKKK) > _PPPP_ZZZZ_EEEE_RRRR_OOOO will make the process interruptible, otherwise it is not.
- The required symbolic constants are defined in _pppp_aaaa_rrrr_aaaa_mmmm_...._hhhh. If the process
- is awakened by a signal, then the semaphore value is incremented and is
- allowed to continue.
-
- To initialize and allocate a semaphore, call _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa or _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa.
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- _pppp_ssss_eeee_mmmm_aaaa returns -1 if a breakable sleep is interrupted by a signal.
- Otherwise _pppp_ssss_eeee_mmmm_aaaa returns 0.
-
- NNNNooootttteeee
- _pppp_ssss_eeee_mmmm_aaaa may cause the calling process to sleep; it must not be called from
- within an interrupt procedure.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- _ssss_llll_eeee_eeee_pppp(D3), _SSSS_LLLL_EEEE_EEEE_PPPP______LLLL_OOOO_CCCC_KKKK(D3)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-